Accessing data from BinBars
Users cannot create their own BinBars. If you would like a BinBar delivered to you and assigned to your account, contact us!
Through the below example queries, data for either one BinBar or all BinBars can be accessed. To see what data can be queried by accessing a BinBar, refer to the BinBar documentation
Accessing weight data over a period of time needs to be be done through container sites instead of through BinBars.
How to find all BinBars
Using the query currentUser
- Query
- Result
query AllBinBars {
currentUser {
account {
binBars {
__typename
name
id
# Some 'BinBar' fields omitted for brevity
}
}
}
}
{
"data": {
"currentUser": {
"account": {
"binBars": [
{
"__typename": "BinBar",
"name": "WW-832",
"id": "abc12345abc12345abc12345"
},
{
"__typename": "BinBar",
"name": "WW-902",
"id": "fb123456abc12345abc12345"
},
{
"__typename": "BinBar",
"name": "WW-420",
"id": "9988123abe932145abc12345"
}
]
}
}
}
}
Larger queries will take longer to retrieve. For larger queries, we recommend using the optional paginationInput. To learn more, visit Paginating Queries
Finding all BinBars that are not linked to a container site is possible by querying for the container site name for all BinBars. The BinBars that do not have container sites will return null for that field
How to find a BinBar's information with an ID
Using the query binBarByID
- Query
- Result
query BinBarByID($id: ID!) {
binBarByID(id: $id) {
__typename
id
name
# Some 'BinBar' fields omitted for brevity
}
}
variables = { id: 'fb123456abc12345abc12345' };
{
"data": {
"binBarByID": {
"__typename": "BinBar",
"id": "fb123456abc12345abc12345",
"name": "WW-902"
}
}
}